function checkDate(fieldValue, allowBlank, minYear, maxYear, showPopup, fieldName) { var errorMsg = ""; //console.log ("Calling Check Date with a value of " + fieldValue + " and a showPopup of " + showPopup); // regular expression to match required date format var re = /^(\d{1,2})\/(\d{1,2})\/(\d{1,4})$/; if(fieldValue != '') { if(regs = fieldValue.match(re)) { var dtMonth = regs[1]; var dtDay = regs[2]; var dtYear = regs[3]; //console.log("Year: " + dtYear); if(dtDay < 1 || dtDay > 31) { errorMsg = "Invalid value for day: " + regs[1]; } else if(dtMonth < 1 || dtMonth > 12) { errorMsg = "Invalid value for month: " + regs[2]; } else if(dtYear < minYear || dtYear > maxYear) { errorMsg = "Invalid value for " + fieldName + " year: " + dtYear + " - must be between " + minYear + " and " + maxYear; } else if ((dtMonth==4 || dtMonth==6 || dtMonth==9 || dtMonth==11) && dtDay ==31) { errorMsg = "Month " + dtMonth + " does not contain 31 days"; } else if (dtMonth == 2 && dtDay > 28) { var isleap = (dtYear % 4 == 0 && (dtYear % 100 != 0 || dtYear % 400 == 0)); if (dtDay> 29 || (dtDay ==29 && !isleap)) errorMsg = "Year " + dtYear + " is not a leap year and does not contain 29 days in February."; } else { errorMsg = ""; } } else { errorMsg = "Invalid date format: " + fieldValue; } } else if(!allowBlank) { errorMsg = "Invalid Date for " + fieldName; } //console.log ("Error Message: " + errorMsg); if(errorMsg != "") { if ( showPopup ) alertify.alert(errorMsg); return false; } return true; } function checkStartDate( showPopup ) { var DOB = $('#dt_DOB').val(); var startDate = $('#dt_StartDate').val(); var errorMessage; if ($('#language').val() == 'es') errorMessage = "Su fecha de nacimiento y fecha de inicio están dentro de 13 años el uno del otro. Por favor revisa estos 2 campos y actualice según sea necesario."; else errorMessage = "Your Date of Birth and Start Date are within 13 years of each other. Please review these 2 fields and update as needed."; var minDifference = 13; if (startDate == '' || DOB == '' || startDate == undefined) { // No comparison to make, let it go. return true; } else { re = /^(\d{1,2})\/(\d{1,2})\/(\d{1,4})$/; if (regs = DOB.match(re)) { var dtDOBMonth = parseInt(regs[1]); var dtDOBDay = parseInt(regs[2]); var dtDOBYear = parseInt(regs[3]); } if (regs = startDate.match(re)) { var dtStartMonth = parseInt(regs[1]); var dtStartDay = parseInt(regs[2]); var dtStartYear = parseInt(regs[3]); } if ( (dtDOBYear + minDifference) < dtStartYear) { // More than minDifference years apart. return true; } else if (dtDOBYear + minDifference == dtStartYear) { if (dtStartMonth > dtDOBMonth) { return true; } else if (dtStartMonth == dtDOBMonth) { if (dtStartDay >= dtDOBDay) { return true; } else { if (showPopup) alertify.alert( errorMessage ); return false; } } else { if (showPopup) alertify.alert( errorMessage ); return false; } } else { if (showPopup) alertify.alert( errorMessage ); return false; } } } function applicantInformation() { //console.log ("i_QuestionnaireHideIntro_Metrics value = " + $('#i_QuestionnaireHideIntro_Metrics').val() ); if ($('#i_QuestionnaireHideIntro_Metrics').val() == 1) { $('#disclaimer_es').hide(); $('#disclaimer_en').hide(); } else if($('#language').val() == "es") { $('#disclaimer_es').show(); $('#disclaimer_en').hide(); } else { $('#disclaimer_es').hide(); $('#disclaimer_en').show(); } callApplicantInformation($('#i_AppID').val(), $('#i_QuestionnaireID').val(), $('#ivrflag').val(), $('#orderId').val(), $('#i_ReceiptID').val(), $('#i_CustID').val(), $('#language').val(), $('#s_FirstName').val(), $('#s_MiddleInit').val(), $('#s_LastName').val(), $('#s_SSN').val(), $('#dt_DOB').val(), "", $('#s_Address1').val(), $('#s_Address2').val(), $('#s_City').val(), $('#s_State').val(), $('#s_Zip').val(), $('#s_County').val(), $('#s_EmailAddress').val(), $('#s_Phone').val(), $('#i_LocID').val(), $('#dt_StartDate').val(), $('#s_JobTitle').val(), $('#m_HourlyWage').val(), $('#rehire').val(), $('#i_IsHired').val(), $('#s_ClientEndAppID').val(), $('#rSessionID').val(), $('#s_Custom1').val(), $('#s_Custom2').val(), $('#s_Custom3').val(), $('#s_Custom4').val(), $('#s_Custom5').val(), $('#s_Target').val(), $('#rURL').val(), $('#TaleoBE_CandidateID').val(), $('#CallCenter').val(), $('#s_Email').val(), $('#token').val() ); } function callApplicantInformation( str0, qid, ivrflag, orderId, i_ReceiptID, i_CustID, language, s_FirstName, s_MiddleInit, s_LastName, s_SSN, dt_DOB, s_Gender, s_Address1, s_Address2, s_City, s_State, s_Zip, s_County, s_EmailAddress, s_Phone, i_LocID, dt_StartDate, s_JobTitle, m_HourlyWage, rehire, i_IsHired, s_ClientEndAppID, rSessionID, s_Custom1, s_Custom2, s_Custom3, s_Custom4, s_Custom5, s_Target, rURL, TaleoBE_CandidateID, CallCenter, s_Email, token) { $('#content').html("

"); var postURL = "https://questionnaire.waltonmgt.com//questionnaire_start.php"; var postVars = {}; postVars['i_AppID'] = str0; postVars['i_QuestionnaireID'] = qid; postVars['ivrflag'] = ivrflag; postVars['orderId'] = orderId; postVars['i_ReceiptID'] = i_ReceiptID; postVars['i_CustID'] = i_CustID; postVars['language'] = language; postVars['s_FirstName'] = s_FirstName; postVars['s_MiddleInit'] = s_MiddleInit; postVars['s_LastName'] = s_LastName; postVars['s_SSN'] = s_SSN; postVars['dt_DOB'] = dt_DOB; postVars['s_Gender'] = s_Gender; postVars['s_Address1'] = s_Address1; postVars['s_Address2'] = s_Address2; postVars['s_City'] = s_City; postVars['s_State'] = s_State; postVars['s_Zip'] = s_Zip; postVars['s_County'] = s_County; postVars['s_EmailAddress'] = s_EmailAddress; postVars['s_Phone'] = s_Phone; postVars['i_LocID'] = i_LocID; postVars['dt_StartDate'] = dt_StartDate; postVars['s_JobTitle'] = s_JobTitle; postVars['m_HourlyWage'] = m_HourlyWage; postVars['rehire'] = rehire; postVars['i_IsHired'] = i_IsHired; postVars['s_ClientEndAppID'] = s_ClientEndAppID; postVars['rSessionID'] = rSessionID; postVars['s_Custom1'] = s_Custom1; postVars['s_Custom2'] = s_Custom2; postVars['s_Custom3'] = s_Custom3; postVars['s_Custom4'] = s_Custom4; postVars['s_Custom5'] = s_Custom5; postVars['s_Target'] = s_Target; postVars['TaleoBE_CandidateID'] = TaleoBE_CandidateID; postVars['CallCenter'] = CallCenter; postVars['rURL'] = decodeURI(rURL); postVars['s_Email'] = s_Email; postVars['token'] = token; //console.log ("calling questionnaire start"); //console.log (postVars); $.post (postURL, postVars, function(data) { $('#content').html (data); } ); } function questionnaire() { var rehireChecked = 0; if (document.getElementById("rehire").checked ) rehireChecked = 1; else rehireChecked = 0; if ($('#i_QuestionnaireHideIntro_Questionnaire').val() == 1) { $('#disclaimer_es').hide(); $('#disclaimer_en').hide(); } else if($('#language').val() == "es") { $('#disclaimer_es').show(); $('#disclaimer_en').hide(); } else { $('#disclaimer_es').hide(); $('#disclaimer_en').show(); } callQuestionnaire($('#i_AppID').val(), $('#i_QuestionnaireID').val(), $('#ivrflag').val(), $('#orderId').val(), $('#i_ReceiptID').val(), $('#i_CustID').val(), $('#language').val(), $('#s_FirstName').val(), $('#s_MiddleInit').val(), $('#s_LastName').val(), $('#s_SSN').val(), $('#dt_DOB').val(), "", $('#s_Address1').val(), $('#s_Address2').val(), $('#s_City').val(), $('#s_State').val(), $('#s_Zip').val(), "", $('#s_EmailAddress').val(), $('#s_Phone').val(), $('#i_LocID').val(), ($('#dt_StartDate').val() == undefined) ? "" : $('#dt_StartDate').val(), ($('#s_JobTitle').val() == undefined) ? "" : $('#s_JobTitle').val(), ($('#m_HourlyWage').val() == undefined) ? "" : $('#m_HourlyWage').val(), rehireChecked, $('#i_IsHired').val(), $('#s_ClientEndAppID').val(), $('#rSessionID').val(), $('#s_Custom1').val(), $('#s_Custom2').val(), $('#s_Custom3').val(), $('#s_Custom4').val(), $('#s_Custom5').val(), $('#s_Target').val(), $('#rURL').val(), $('#orderId').val(), $('#i_ReceiptID').val(), $('#TaleoBE_CandidateID').val(), $('#CallCenter').val(), $('#s_EmailAddress').val(), $('#token').val() ); } function callQuestionnaire(str0, qid, ivrflag, orderId, i_ReceiptID, i_CustID, language, s_FirstName, s_MiddleInit, s_LastName, s_SSN, dt_DOB, s_Gender, s_Address1, s_Address2, s_City, s_State, s_Zip, s_County, s_EmailAddress, s_Phone, i_LocID, dt_StartDate, s_JobTitle, m_HourlyWage, rehire, i_IsHired, s_ClientEndAppID, rSessionID, s_Custom1, s_Custom2, s_Custom3, s_Custom4, s_Custom5, s_Target, rURL, orderId, i_ReceiptID, TaleoBE_CandidateID, CallCenter, s_EmailAddress, token) { $('#content').html("

"); var postURL = "https://questionnaire.waltonmgt.com//questionnaire.php"; //console.log ("Received a rURL of " + decodeURI( decodeURI(rURL) )); var postVars = {}; postVars['i_AppID'] = str0; postVars['i_QuestionnaireID'] = qid; postVars['ivrflag'] = ivrflag; postVars['orderId'] = orderId; postVars['i_ReceiptID'] = i_ReceiptID; postVars['i_CustID'] = i_CustID; postVars['language'] = language; postVars['s_FirstName'] = s_FirstName; postVars['s_MiddleInit'] = s_MiddleInit; postVars['s_LastName'] = s_LastName; postVars['s_SSN'] = s_SSN; postVars['dt_DOB'] = dt_DOB; postVars['s_Gender'] = s_Gender; postVars['s_Address1'] = s_Address1; postVars['s_Address2'] = s_Address2; postVars['s_City'] = s_City; postVars['s_State'] = s_State; postVars['s_Zip'] = s_Zip; postVars['s_County'] = s_County; postVars['s_EmailAddress'] = s_EmailAddress; postVars['s_Phone'] = s_Phone; postVars['i_LocID'] = i_LocID; postVars['dt_StartDate'] = dt_StartDate; postVars['s_JobTitle'] = s_JobTitle; postVars['m_HourlyWage'] = m_HourlyWage; postVars['rehire'] = rehire; postVars['i_IsHired'] = i_IsHired; postVars['s_ClientEndAppID'] = s_ClientEndAppID; postVars['rSessionID'] = rSessionID; postVars['s_Custom1'] = s_Custom1; postVars['s_Custom2'] = s_Custom2; postVars['s_Custom3'] = s_Custom3; postVars['s_Custom4'] = s_Custom4; postVars['s_Custom5'] = s_Custom5; postVars['s_Target'] = s_Target; postVars['rURL'] = decodeURI(rURL); postVars['orderId'] = orderId; postVars['i_ReceiptID'] = i_ReceiptID; postVars['TaleoBE_CandidateID'] = TaleoBE_CandidateID; postVars['CallCenter'] = CallCenter; postVars['s_EmailAddress'] = s_EmailAddress; postVars['pAction'] = "new"; postVars['token'] = token; $.post (postURL, postVars, function(data) { $('#content').html (data); } ); } function callQuestionnairePreloaded () { var postURL = "https://questionnaire.waltonmgt.com//questionnaire.php"; console.log ("Calling questionnaire and skipping metrics - applicant ID of " + $('#i_AppID').val() + " and language of " + $('#language').val() ); if ($('#i_QuestionnaireHideIntro_Questionnaire').val() == 1) { $('#disclaimer_es').hide(); $('#disclaimer_en').hide(); } else if ($('#language').val() == "es") { $('#disclaimer_es').show(); $('#disclaimer_en').hide(); } else { $('#disclaimer_es').hide(); $('#disclaimer_en').show(); } var postVars = {}; postVars['i_AppID'] = $('#i_AppID').val(); postVars['i_CustID'] = $('#i_CustID').val(); postVars['language'] = $('#language').val(); postVars['skipMetrics'] = 1; postVars['pAction'] = 'new'; postVars['token'] = $('#token').val(); $('#content').html("

"); $.post ("questionnaire.php", postVars, function(data) { $('#content').html(data); } ); } function printPage() { var optout = 0; if ($('#optout').is(':checked') ) optout = 1; if ($('#i_QuestionnaireHideIntro_Print').val() == 1) { $('#disclaimer_es').hide(); $('#disclaimer_en').hide(); } else if($('#language').val() == "es") { $('#disclaimer_es').show(); $('#disclaimer_en').hide(); } else { $('#disclaimer_es').hide(); $('#disclaimer_en').show(); } callPrintPage( optout, $('input[name=qLTUI]:checked', '#myForm').val(), $('input[name=qLTUI_1]:checked', '#myForm').val(), $('#ivrflag').val(), $('input[name=qNYMinWage_YN]:checked', '#myForm').val(), $('#qNYMinWage_SchoolName').val(), $('input[name=qNYMinWage_FT_PT]:checked', '#myForm').val(), $('#orderId').val(), $('#i_ReceiptID').val(), $('#language').val(), $('#s_ClientEndAppID').val(), $('#rSessionID').val(), $('#s_Custom1').val(), $('#s_Custom2').val(), $('#s_Custom3').val(), $('#s_Custom4').val(), $('#s_Custom5').val(), $('#s_Target').val(), $('#rURL').val(), $('#i_AppID').val(), $('#q1').val(), ($('input[name=q1_1]:checked', '#myForm').val() == undefined) ? "" : $('input[name=q1_1]:checked', '#myForm').val(), ($('input[name=q1_2]:checked', '#myForm').val() == undefined) ? "" : $('input[name=q1_2]:checked', '#myForm').val(), ($('input[name=q1_3]:checked', '#myForm').val() == undefined) ? "" : $('input[name=q1_3]:checked', '#myForm').val(), $('input[name=q2]:checked', '#myForm').val(), ($('#q2_1')) ? $('#q2_1').val() : "", ($('#q2_2')) ? $('#q2_2').val() : "", ($('#q2_3')) ? $('#q2_3').val() : "", ($('#q2_4')) ? $('#q2_4').val() : "", ($('#q2_5')) ? $('#q2_5').val() : "", $("select#q2_6").val(), $('input[name=q3]:checked', '#myForm').val(), $('#q3_1').val(), $('#q3_2').val(), $('#q3_3').val(), $('#q3_4').val(), $('#q3_5').val(), $("select#q3_6").val(), $('input[name=q4]:checked', '#myForm').val(), $('#q4_1').val(), $('#q4_2').val(), $('#q4_3').val(), $('#q4_4').val(), $('input[name=q5]:checked', '#myForm').val(), $('#q5_1').val(), $('#q5_2').val(), $('#q5_3').val(), $('#q5_4').val(), $('input[name=q6]:checked', '#myForm').val(), $('#q6_1').val(), ($('input[name=q6_2]:checked', '#myForm').val() == undefined) ? "" : $('input[name=q6_2]:checked', '#myForm').val(), ($('input[name=q6_3]:checked', '#myForm').val() == undefined) ? "" : $('input[name=q6_3]:checked', '#myForm').val(), ($('input[name=q6_4]:checked', '#myForm').val() == undefined) ? "" : $('input[name=q6_4]:checked', '#myForm').val(), ($('input[name=q6_5]:checked', '#myForm').val() == undefined) ? "" : $('input[name=q6_5]:checked', '#myForm').val(), $('input[name=q7]:checked', '#myForm').val(), $('#q7_1').val(), ($('input[name=q7_2]:checked', '#myForm').val() == undefined) ? "" : $('input[name=q7_2]:checked', '#myForm').val(), $('#q7_3').val(), ($('input[name=calworks_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=calworks_y]:checked', '#myForm').val(), ($('input[name=econdisadv_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=econdisadv_y]:checked', '#myForm').val(), ($('input[name=term_unemp_y_1]:checked', '#myForm').val() == undefined) ? "" : $('input[name=term_unemp_y_1]:checked', '#myForm').val(), ($('input[name=term_unemp_y_2]:checked', '#myForm').val() == undefined) ? "" : $('input[name=term_unemp_y_2]:checked', '#myForm').val(), ($('input[name=plant_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=plant_y]:checked', '#myForm').val(), ($('#plantname').val() == undefined) ? "" : $('#plantname').val(), ($('input[name=longterm_unemp_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=longterm_unemp_y]:checked', '#myForm').val(), ($('input[name=generalecon_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=generalecon_y]:checked', '#myForm').val(), ($('input[name=dodciv_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=dodciv_y]:checked', '#myForm').val(), ($('input[name=mil_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=mil_y]:checked', '#myForm').val(), ($('input[name=seasonal_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=seasonal_y]:checked', '#myForm').val(), ($('input[name=cleanair_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=cleanair_y]:checked', '#myForm').val(), ($('input[name=disabled_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=disabled_y]:checked', '#myForm').val(), ($('input[name=vietvet_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=vietvet_y]:checked', '#myForm').val(), ($('input[name=native_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=native_y]:checked', '#myForm').val(), ($('input[name=q9]:checked', '#myForm').val() == undefined) ? "" : $('input[name=q9]:checked', '#myForm').val(), $('#qNAIE_Tribe_Name_Other').val(), $('#i_CustID').val(), $('#TaleoBE_CandidateID').val(), //NY Youth ($('#NY_Youth_Parent_Fname').val() == undefined) ? "" : $('#NY_Youth_Parent_Fname').val(), ($('#NY_Youth_Parent_Lname').val() == undefined) ? "" : $('#NY_Youth_Parent_Lname').val(), ($('#NY_Youth_Parent_Phone').val() == undefined) ? "" : $('#NY_Youth_Parent_Phone').val(), ($('input[name=NY_Youth_Assisted_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=NY_Youth_Assisted_y]:checked', '#myForm').val(), ($('input[name=NY_Youth_working_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=NY_Youth_working_y]:checked', '#myForm').val(), ($('#NY_Youth_dt_Current_Employment').val() == undefined) ? "" : $('#NY_Youth_dt_Current_Employment').val(), ($('input[name=NY_Youth_school_lunch_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=NY_Youth_school_lunch_y]:checked', '#myForm').val(), ($('input[name=NY_Youth_pregnant_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=NY_Youth_pregnant_y]:checked', '#myForm').val(), ($('input[name=NY_Youth_homeless_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=NY_Youth_homeless_y]:checked', '#myForm').val(), ($('input[name=NY_Youth_foster_care_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=NY_Youth_foster_care_y]:checked', '#myForm').val(), ($('input[name=NY_Youth_Parent_Felon_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=NY_Youth_Parent_Felon_y]:checked', '#myForm').val(), ($('input[name=NY_Youth_Parent_Unemployment_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=NY_Youth_Parent_Unemployment_y]:checked', '#myForm').val(), ($('input[name=NY_Youth_Section_8_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=NY_Youth_Section_8_y]:checked', '#myForm').val(), ($('input[name=NY_Youth_Other_Pub_Housing_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=NY_Youth_Other_Pub_Housing_y]:checked', '#myForm').val(), ($('#NY_Youth_Other_Pub_Housing_text').val() == undefined) ? "" : $('#NY_Youth_Other_Pub_Housing_text').val(), ($('input[name=VT_Veteran_Unemployment_y]:checked', '#myForm').val() == undefined) ? "" : $('input[name=VT_Veteran_Unemployment_y]:checked', '#myForm').val(), //extra fields, rename them later, but they'll work with these names for now ($('input[name=qe1]:checked', '#myForm').val() == undefined) ? "" : $('input[name=qe1]:checked', '#myForm').val(), ($('input[name=qe2]:checked', '#myForm').val() == undefined) ? "" : $('input[name=qe2]:checked', '#myForm').val(), ($('input[name=qe3]:checked', '#myForm').val() == undefined) ? "" : $('input[name=qe3]:checked', '#myForm').val(), ($('input[name=qe4]:checked', '#myForm').val() == undefined) ? "" : $('input[name=qe4]:checked', '#myForm').val(), ($('input[name=qe5]:checked', '#myForm').val() == undefined) ? "" : $('input[name=qe5]:checked', '#myForm').val(), ($('input[name=qe6]:checked', '#myForm').val() == undefined) ? "" : $('input[name=qe6]:checked', '#myForm').val(), ($('#qe7').val() == undefined) ? "" : $('#qe7').val(), ($('input[name=qe8]:checked', '#myForm').val() == undefined) ? "" : $('input[name=qe8]:checked', '#myForm').val(), ($('input[name=qe9]:checked', '#myForm').val() == undefined) ? "" : $('input[name=qe9]:checked', '#myForm').val(), ($('input[name=qe10]:checked', '#myForm').val() == undefined) ? "" : $('input[name=qe10]:checked', '#myForm').val(), $('input[name=q8]:checked', '#myForm').val(), $('#s_Zip').val(), ($('#NY_Youth_CellPhone').val() == undefined) ? "" : $('#NY_Youth_CellPhone').val(), $('#token').val() ); } function callPrintPage(optout, strLTUI, strLTUI_1, ivrflag, strNYMinWage_YN, strNYMinWage_SchoolName, strNYMinWage_FT_PT, orderId, i_ReceiptID, language, s_ClientEndAppID, rSessionID, s_Custom1, s_Custom2, s_Custom3, s_Custom4, s_Custom5, s_Target, rURL, i_AppID, q1, q1_1, q1_2, q1_3, q2, q2_1, q2_2, q2_3, q2_4, q2_5, q2_6, q3, q3_1, q3_2, q3_3, q3_4, q3_5, q3_6, q4, q4_1, q4_2, q4_3, q4_4, q5, q5_1, q5_2, q5_3, q5_4, q6, q6_1, q6_2, q6_3, q6_4, q6_5, q7, q7_1, q7_2, q7_3, calworks_y, econdisadv_y, term_unemp_y_1, term_unemp_y_2, plant_y, plantname, longterm_unemp_y, generalecon_y, dodciv_y, mil_y, seasonal_y, cleanair_y, disabled_y, vietvet_y, native_y, q9, qNAIE_TribalName, i_CustID, TaleoBE_CandidateID, NY1, NY2, NY3, NY4, NY5, NY6, NY7, NY8, NY9, NY10, NY11, NY12, NY13, NY14, NY15, VT1, qe1, qe2, qe3, qe4, qe5, qe6, qe7, qe8, qe9, qe10, q8, s_Zip, NY16, token) { $('#content').html("

"); var postURL = "https://questionnaire.waltonmgt.com//questionnaire_print.php"; console.log ("Received a rURL of " + decodeURI( decodeURI(rURL) )); var postVars = {}; postVars['optout'] = optout; postVars['orderId'] = orderId; postVars['ivrflag'] = ivrflag; postVars['i_ReceiptID'] = i_ReceiptID; postVars['language'] = language; postVars['s_ClientEndAppID'] = s_ClientEndAppID; postVars['rSessionID'] = rSessionID; postVars['s_Custom1'] = s_Custom1; postVars['s_Custom2'] = s_Custom2; postVars['s_Custom3'] = s_Custom3; postVars['s_Custom4'] = s_Custom4; postVars['s_Custom5'] = s_Custom5; postVars['s_Target'] = s_Target; postVars['rURL'] = rURL; postVars['i_AppID'] = i_AppID; postVars['q1'] = q1; postVars['q1_1'] = q1_1; postVars['q1_2'] = q1_2; postVars['q1_3'] = q1_3; postVars['q2'] = q2; postVars['q2_1'] = q2_1; postVars['q2_1'] = q2_1; postVars['q2_2'] = q2_2; postVars['q2_3'] = q2_3; postVars['q2_4'] = q2_4; postVars['q2_5'] = q2_5; postVars['q2_6'] = q2_6; postVars['q3'] = q3; postVars['q3_1'] = q3_1; postVars['q3_2'] = q3_2; postVars['q3_3'] = q3_3; postVars['q3_4'] = q3_4; postVars['q3_5'] = q3_5; postVars['q3_6'] = q3_6; postVars['q4'] = q4; postVars['q4_1'] = q4_1; postVars['q4_2'] = q4_2; postVars['q4_3'] = q4_3; postVars['q4_4'] = q4_4; postVars['q5'] = q5; postVars['q5_1'] = q5_1; postVars['q5_2'] = q5_2; postVars['q5_3'] = q5_3; postVars['q5_4'] = q5_4; postVars['q6'] = q6; postVars['q6_1'] = q6_1; postVars['q6_2'] = q6_2; postVars['q6_3'] = q6_3; postVars['q6_4'] = q6_4; postVars['q6_5'] = q6_5; postVars['q7'] = q7; postVars['q7_1'] = q7_1; postVars['q7_2'] = q7_2; postVars['q7_3'] = q7_3; postVars['qLTUI'] = strLTUI; postVars['qLTUI_1'] = strLTUI_1; postVars['qNYMinWage_YN'] = strNYMinWage_YN; postVars['qNYMinWage_SchoolName'] = strNYMinWage_SchoolName; postVars['qNYMinWage_FT_PT'] = strNYMinWage_FT_PT; postVars['calworks_y'] = calworks_y; postVars['econdisadv_y'] = econdisadv_y; postVars['term_unemp_y_1'] = term_unemp_y_1; postVars['term_unemp_y_2'] = term_unemp_y_2; postVars['plant_y'] = plant_y; postVars['plantname'] = plantname; postVars['longterm_unemp_y'] = longterm_unemp_y; postVars['generalecon_y'] = generalecon_y; postVars['dodciv_y'] = dodciv_y; postVars['mil_y'] = mil_y; postVars['seasonal_y'] = seasonal_y; postVars['cleanair_y'] = cleanair_y; postVars['disabled_y'] = disabled_y; postVars['vietvet_y'] = vietvet_y; postVars['native_y'] = native_y; postVars['q9'] = q9; postVars['naie_tribe_name'] = qNAIE_TribalName; postVars['i_CustID'] = i_CustID; postVars['TaleoBE_CandidateID'] = TaleoBE_CandidateID; postVars['NY1'] = NY1; postVars['NY2'] = NY2; postVars['NY3'] = NY3; postVars['NY4'] = NY4; postVars['NY5'] = NY5; postVars['NY6'] = NY6; postVars['NY7'] = NY7; postVars['NY8'] = NY8; postVars['NY9'] = NY9; postVars['NY10'] = NY10; postVars['NY11'] = NY11; postVars['NY12'] = NY12; postVars['NY13'] = NY13; postVars['NY14'] = NY14; postVars['NY15'] = NY15; postVars['NY16'] = NY16; postVars['VT1'] = VT1; postVars['qe1'] = qe1; postVars['qe2'] = qe2; postVars['qe3'] = qe3; postVars['qe4'] = qe4; postVars['qe5'] = qe5; postVars['qe6'] = qe6; postVars['qe7'] = qe7; postVars['qe8'] = qe8; postVars['qe9'] = qe9; postVars['qe10'] = qe10; postVars['q8'] = q8; postVars['pAction'] = "questionnaire"; postVars['s_Zip'] = s_Zip; postVars['token'] = token; /* // Not used anymore, clearly.. "&NY_Youth_Parent_Fname=" + str68 + "&NY_Youth_Parent_Lname=" + str69 + "&NY_Youth_Parent_Phone=" + str70 + "&NY_Youth_Assisted_y=" + str71 + "&NY_Youth_working_y=" + str72 + "&NY_Youth_dt_Current_Employment=" + str73 + "&NY_Youth_school_lunch_y=" + str74 + "&NY_Youth_pregnant_y=" + str75 + "&NY_Youth_homeless_y=" + str76 + "&NY_Youth_foster_care_y=" + str77 + "&NY_Youth_Parent_Felon_y=" + str78 + "&NY_Youth_Parent_Unemployment_y=" + str79 + "&NY_Youth_Section_8_y=" + str80 + "&NY_Youth_Other_Pub_Housing_y=" + str81 + "&NY_Youth_Other_Pub_Housing_text=" + str82 + */ $.post (postURL, postVars, function(data) { $('#content').html (data); } ); } function abortQuestionnaire( ) { var optout = 0; if ($('#optout').is(':checked') ) optout = 1; if ($('#i_QuestionnaireHideIntro_Print').val() == 1) { $('#disclaimer_es').hide(); $('#disclaimer_en').hide(); } else if($('#language').val() == "es") { $('#disclaimer_es').show(); $('#disclaimer_en').hide(); } else { $('#disclaimer_es').hide(); $('#disclaimer_en').show(); } var i_CustID = $('#i_CustID').val(); var i_AppID = $('#i_AppID').val(); var rURL = $('#rURL').val(); $('#content').html("

"); var postURL = "https://questionnaire.waltonmgt.com//questionnaire_print.php"; var postVars = {}; postVars['i_AppID'] = i_AppID; postVars['i_CustID'] = i_CustID; postVars['rURL'] = rURL; postVars['pAction'] = 'abort'; postVars['token'] = $('#token').val(); $.post (postURL, postVars, function(data) { $('#content').html (data); } ); } function validate_questionnaire_applicant(myForm) { var errorMessage = ""; if(myForm.s_FirstName.value.length == 0 || !isValidName(myForm.s_FirstName)) { myForm.s_FirstName.select(); myForm.s_FirstName.focus(); if ($('#language').val() == 'es') errorMessage = "Por favor, introduzca un nombre primer para continuar. Por favor, sólo utilice letras, guiones o comillas simples."; else errorMessage = "Please enter a first name to continue. Please only use letters, hyphens or single quotes."; alertify.alert("Error!", errorMessage); return false; } if(myForm.s_MiddleInit.value.length > 0 && !isValidName(myForm.s_MiddleInit)) { myForm.s_MiddleInit.select(); myForm.s_MiddleInit.focus(); if ($('#language').val() == 'es') errorMessage = "Middle Initial must be a letter."; else errorMessage = "Middle Initial must be a letter."; alertify.alert("Error!", errorMessage); return false; } if(myForm.s_LastName.value.length == 0 || !isValidName(myForm.s_LastName)) { myForm.s_LastName.select(); myForm.s_LastName.focus(); if ($('#language').val() == 'es') errorMessage = "Por favor, introduzca un nombre de familia para continuar. Por favor, sólo utilice letras, guiones o comillas simples."; else errorMessage = "Please enter a last name to continue. Please only use letters, hyphens or single quotes."; alertify.alert("Error!", errorMessage); return false; } if ( !checkDate ($('#dt_DOB').val(), false, 1902, new Date().getFullYear() - 13, false, "" ) ) { myForm.dt_DOB.select(); myForm.dt_DOB.focus(); if ($('#language').val() == 'es') errorMessage = "Por favor, introduzca una fecha válida de nacimiento con el formato mm/dd/aaaa para continuar."; else errorMessage = "Please enter a valid date of birth of the form mm/dd/yyyy to continue."; alertify.alert("Error!", errorMessage); return false; } if (!checkStartDate(true) ) return false; if(myForm.s_SSN.value.length == 0 || !isValidSSN(myForm.s_SSN)) { myForm.s_SSN.select(); myForm.s_SSN.focus(); if ($('#language').val() == 'es') errorMessage = "Por favor, introduzca un número de Seguro Social válido utilizar sólo números."; else errorMessage = "Please enter a valid SSN using only numbers."; alertify.alert("Error!", errorMessage); return false; } if(myForm.s_Address1.value.length == 0) { myForm.s_Address1.select(); myForm.s_Address1.focus(); if ($('#language').val() == 'es') errorMessage = "Por favor, introduzca una dirección a seguir."; else errorMessage = "Please enter an address to continue."; alertify.alert("Error!", errorMessage); return false; } else { var regex = /^[a-zA-Z0-9äöüÄÖÜ #]*$/; var key = myForm.s_Address1.value; if (!regex.test(key)) { myForm.s_Address1.select(); myForm.s_Address1.focus(); errorMessage = "Please only use letters, numbers, spaces and the # symbol in your address."; alertify.alert("Error!", errorMessage); return false; } } if (myForm.s_Address2.value.length > 0) { var regex = /^[a-zA-Z0-9äöüÄÖÜ #]*$/; var key = myForm.s_Address2.value; if (!regex.test(key)) { myForm.s_Address2.select(); myForm.s_Address2.focus(); errorMessage = "Please only use letters, numbers, spaces and the # symbol in your address."; alertify.alert("Error!", errorMessage); return false; } } if(myForm.s_City.value.length == 0) { myForm.s_City.select(); myForm.s_City.focus(); if ($('#language').val() == 'es') errorMessage = "Por favor introduzca una ciudad para continuar."; else errorMessage = "Please enter a city to continue."; alertify.alert("Error!", errorMessage); return false; } else { var regex = /^[a-zA-Z0-9äöüÄÖÜ #]*$/; var key = myForm.s_City.value; if (!regex.test(key)) { myForm.s_City.select(); myForm.s_City.focus(); errorMessage = "Please only use letters, numbers, spaces and the # symbol in your city."; alertify.alert("Error!", errorMessage); return false; } } if( $('#s_State').val() == '') { myForm.s_State.focus(); if ($('#language').val() == 'es') errorMessage = "Por favor seleccione un estado para continuar."; else errorMessage = "Please select a state to continue."; alertify.alert("Error!", errorMessage); return false; } if(myForm.s_Zip.value.length == 0 || !isValidZip(myForm.s_Zip)) { myForm.s_Zip.select(); myForm.s_Zip.focus(); if ($('#language').val() == 'es') errorMessage = "Introduce un código postal válido para continuar."; else errorMessage = "Please enter a valid zip code to continue."; alertify.alert("Error!", errorMessage); return false; } if(myForm.s_EmailAddress.value.length > 0 && !isValidEmail(myForm.s_EmailAddress)) { myForm.s_EmailAddress.select(); myForm.s_EmailAddress.focus(); if ($('#language').val() == 'es') errorMessage = "Please enter a valid email address."; else errorMessage = "Please enter a valid email address."; alertify.alert("Error!", errorMessage); return false; } if(myForm.s_Phone.value.length != 0 && !isValidPhone(myForm.s_Phone)) { myForm.s_Phone.select(); myForm.s_Phone.focus(); if ($('#language').val() == 'es') errorMessage = "Si introduce un número de teléfono, por favor, asegúrese de introducir 10 dígitos sin ningún carácter especial para continuar."; else errorMessage = "If you are entering a phone number, please make sure you enter 10 digits without any special characters to continue."; alertify.alert("Error!", errorMessage); return false; } if(myForm.i_LocID.selectedIndex == 0) { myForm.i_LocID.focus(); if ($('#language').val() == 'es') errorMessage = "Por favor, seleccione una ubicación para continuar."; else errorMessage = "Please select a location to continue."; alertify.alert("Error!", errorMessage); return false; } if(myForm.i_HireDefault.value != 0) { if (myForm.s_JobTitle.value.length != 0) { var regex = /^[a-zA-Z0-9äöüÄÖÜ #]*$/; var key = myForm.s_JobTitle.value; if (!regex.test(key)) { myForm.s_JobTitle.select(); myForm.s_JobTitle.focus(); errorMessage = "Please only use letters, numbers, spaces and the # symbol in your job title."; alertify.alert("Error!", errorMessage); return false; } } if(myForm.dt_StartDate.value.length != 0 && !isValidDate(myForm.dt_StartDate)) { myForm.dt_StartDate.select(); myForm.dt_StartDate.focus(); if ($('#language').val() == 'es') errorMessage = "Por favor, introduzca una fecha de inicio de validez del formato mm / dd / aaaa para continuar."; else errorMessage = "Please enter a valid start date of the form mm/dd/yyyy to continue."; alertify.alert("Error!", errorMessage); return false; } if(myForm.m_HourlyWage.value.length != 0 && !isValidCurrency(myForm.m_HourlyWage)) { myForm.m_HourlyWage.select(); myForm.m_HourlyWage.focus(); if ($('#language').val() == 'es') errorMessage = "Por favor, introduzca su salario en un formato de salario por hora válida Un empleado asalariado puede estimar su precio por hora dividiendo sus ingresos a la mitad y mover el decimal 3 lugares a la izquierda . (es decir $ 40,000.00 por año / 2 = $ 20,000.00 , moviendo el decimal = $ 20.00 / hora ) Si usted todavía no está seguro de su salario por hora , por favor, limpiar el campo y haga clic en el botón Continuar para continuar con el resto de la encuesta."; else errorMessage = "Please enter your salary in a valid hourly wage format ($$.cc). A salaried employee can estimate their hourly rate by dividing their income in half and moving the decimal 3 places to the left. (i.e. $40,000.00 per year / 2 = $20,000.00, moving the decimal = $20.00/hour) If you are still unsure of your hourly salary, please clear the field and click the Continue button to proceed with the rest of the survey."; alertify.alert("Error!", errorMessage); return false; } } //return true; questionnaire(); } function switchid(id, state) { showdiv(id); //showdiv('s_CountyLabel'); } function subquestion(id, answer) { //if being asked to show sub questions for #7, verify that either (5 or 7) == (Y or U) if(id == "7") { var q5_val = ""; var q7_val = ""; //get the checked values of q5 for (var i=0; i < document.myForm.q5.length; i++) if (document.myForm.q5[i].checked) q5_val = document.myForm.q5[i].value; //get the checked values of q7 for (var i=0; i < document.myForm.q7.length; i++) if (document.myForm.q7[i].checked) q7_val = document.myForm.q7[i].value; if((q5_val == "Y" || q5_val == "U") || (q7_val == "Y" || q7_val == "U")) showdiv("sq7"); else hidediv("sq7"); //mark question as answered in the question map if(q5_val == "Y" || q5_val == "N" || q5_val == "U") document.getElementById('mapimg5').src = "/common/images/checkmark.png"; if(q7_val == "Y" || q7_val == "N" || q7_val == "U") document.getElementById('mapimg7').src = "/common/images/checkmark.png"; } else if(id == "8") { document.getElementById('mapimg' + id).src = "/common/images/checkmark.png"; } else { //for any subquestions besides 7, show or hide accordingly if(answer == "Y" || answer == "U") showdiv("sq" + id); else hidediv("sq" + id); //mark question as answered in the question map document.getElementById('mapimg' + id).src = "/common/images/checkmark.png"; } } function resetQuestionnaire() { //change all the completed check marks to red Xs for(i=2; i<=7; i++) document.getElementById('mapimg' + i).src = "/common/images/bluebox.png"; //hide all the subquestions for(i=2; i<=7; i++) hidediv("sq" + i); //reset hire question image, if exists var hireElement = document.getElementById("mapimghire"); if (hireElement != null) { document.getElementById('mapimghire').src = "/common/images/bluebox.png"; } //reset perjury question document.getElementById('mapimg8').src = "/common/images/bluebox.png"; //reset indian act question document.getElementById('mapimg9').src = "/common/images/bluebox.png"; onloadQuestionnaire(); } function onloadQuestionnaire() { //if between 16 and 24, show sub questions if(document.getElementById("age").value >= 16 && document.getElementById("age").value <= 39) { //show subquestions showdiv("sq1"); } /* */ if(myForm.q2[0].checked) subquestion("2", "Y"); else if(myForm.q2[1].checked) subquestion("2", "N"); else if(myForm.q2[2].checked) subquestion("2", "U"); if(myForm.q3[0].checked) subquestion("3", "Y"); else if(myForm.q3[1].checked) subquestion("3", "N"); else if(myForm.q3[2].checked) subquestion("3", "U"); if(myForm.q4[0].checked) subquestion("4", "Y"); else if(myForm.q4[1].checked) subquestion("4", "N"); else if(myForm.q4[2].checked) subquestion("4", "U"); if(myForm.q5[0].checked) subquestion("5", "Y"); else if(myForm.q5[1].checked) subquestion("5", "N"); else if(myForm.q5[2].checked) subquestion("5", "U"); if(myForm.q6[0].checked) subquestion("6", "Y"); else if(myForm.q6[1].checked) subquestion("6", "N"); else if(myForm.q6[2].checked) subquestion("6", "U"); if(myForm.q7[0].checked) subquestion("7", "Y"); else if(myForm.q7[1].checked) subquestion("7", "N"); else if(myForm.q7[2].checked) subquestion("7", "U"); if(myForm.q8[0].checked) subquestion("8", "Y"); else if(myForm.q8[1].checked) subquestion("8", "N"); else if(myForm.q8[2].checked) subquestion("8", "U"); if(myForm.q9[0].checked) subquestion("9", "Y"); if(myForm.qLTUI[0].checked) subquestion("LTUI", "Y"); else if(myForm.qLTUI[1].checked) subquestion("LTUI", "N"); else if(myForm.qLTUI[2].checked) subquestion("LTUI", "U"); } function validate_questionnaire_questionnaire(myForm) { //LTUI var errorMessage; if(!myForm.qLTUI[0].checked && !myForm.qLTUI[1].checked && !myForm.qLTUI[2].checked) { var Question_label = document.getElementById('qLTUI_label').value; if ($('#language').val() == 'es') errorMessage = "Por favor, conteste la pregunta " + Question_label + " para continuar."; else errorMessage = "Please answer question " + Question_label + " to continue."; alertify.alert("Error!", errorMessage); return false; } else if ((myForm.qLTUI[0].checked || myForm.qLTUI[2].checked) ) { var Question_label = document.getElementById('qLTUI_label').value; if (!myForm.qLTUI_1[0].checked && !myForm.qLTUI_1[1].checked && !myForm.qLTUI_1[2].checked) { myForm.qLTUI_1[0].focus(); if ($('#language').val() == 'es') errorMessage = "Por favor, conteste la pregunta " + Question_label + ".1 para continuar."; else errorMessage = "Please answer question " + Question_label + ".1 to continue."; alertify.alert("Error!", errorMessage); return false; } } //Q2 if(!myForm.q2[0].checked && !myForm.q2[1].checked && !myForm.q2[2].checked) { var Question_label = document.getElementById('qAFDC_label').value; if ($('#language').val() == 'es') errorMessage = "Por favor, conteste la pregunta " + Question_label + " para continuar."; else errorMessage = "Please answer question " + Question_label + " to continue."; alertify.alert("Error!", errorMessage); return false; } else if((myForm.q2[0].checked || myForm.q2[2].checked)) { // Check recipient name if (myForm.q2_1.value.length > 0 && !isValidName(myForm.q2_1)) { myForm.q2_1.select(); myForm.q2_1.focus(); if ($('#language').val() == 'es') errorMessage = "Please enter a valid name."; else errorMessage = "Please enter a valid name."; alertify.alert("Error!", errorMessage); return false; } // Check SSN. if (myForm.q2_2.value.length > 0 && !isValidSSN(myForm.q2_2)) { //if q2 = Y or U, and a SSN was entered, verify that it is a valid SSN myForm.q2_2.select(); myForm.q2_2.focus(); if ($('#language').val() == 'es') errorMessage = "Por favor, introduzca un número de Seguro Social válido utilizar sólo números."; else errorMessage = "Please enter a valid SSN using only numbers."; alertify.alert("Error!", errorMessage); return false; } // Check Case # if (myForm.q2_3.value.length > 0) { var regex = /^[a-zA-Z0-9äöüÄÖÜ #]*$/; var key = myForm.q2_3.value; if (!regex.test(key)) { myForm.q2_3.select(); myForm.q2_3.focus(); errorMessage = "Please only use letters, numbers, spaces and the # symbol in your case number."; alertify.alert("Error!", errorMessage); return false; } } // Check Relationship if (myForm.q2_4.value.length > 0) { var regex = /^[a-zA-Z0-9äöüÄÖÜ #]*$/; var key = myForm.q2_4.value; if (!regex.test(key)) { myForm.q2_4.select(); myForm.q2_4.focus(); errorMessage = "Please only use letters, numbers, spaces and the # symbol in your relationship."; alertify.alert("Error!", errorMessage); return false; } } // Check Relationship if (myForm.q2_5.value.length > 0) { var regex = /^[a-zA-Z0-9äöüÄÖÜ #]*$/; var key = myForm.q2_5.value; if (!regex.test(key)) { myForm.q2_5.select(); myForm.q2_5.focus(); errorMessage = "Please only use letters, numbers, spaces and the # symbol in your city."; alertify.alert("Error!", errorMessage); return false; } } } //Q3 if(!myForm.q3[0].checked && !myForm.q3[1].checked && !myForm.q3[2].checked) { var Question_label = $('#qSNAP_label').val(); if ($('#language').val() == 'es') errorMessage = "Por favor, conteste la pregunta " + Question_label + " para continuar."; else errorMessage = "Please answer question " + Question_label + " to continue."; alertify.alert("Error!", errorMessage); return false; } else if((myForm.q3[0].checked || myForm.q3[2].checked) ) { // Check recipient name if (myForm.q3_1.value.length > 0 && !isValidName(myForm.q3_1)) { myForm.q3_1.select(); myForm.q3_1.focus(); if ($('#language').val() == 'es') errorMessage = "Please enter a valid name."; else errorMessage = "Please enter a valid name."; alertify.alert("Error!", errorMessage); return false; } // Check SSN. if (myForm.q3_2.value.length > 0 && !isValidSSN(myForm.q3_2)) { //if q3 = Y or U, and a SSN was entered, verify that it is a valid SSN myForm.q3_2.select(); myForm.q3_2.focus(); if ($('#language').val() == 'es') errorMessage = "Por favor, introduzca un número de Seguro Social válido utilizar sólo números."; else errorMessage = "Please enter a valid SSN using only numbers."; alertify.alert("Error!", errorMessage); return false; } // Check Case # if (myForm.q3_3.value.length > 0) { var regex = /^[a-zA-Z0-9äöüÄÖÜ #]*$/; var key = myForm.q3_3.value; if (!regex.test(key)) { myForm.q3_3.select(); myForm.q3_3.focus(); errorMessage = "Please only use letters, numbers, spaces and the # symbol in your case number."; alertify.alert("Error!", errorMessage); return false; } } // Check Relationship if (myForm.q3_4.value.length > 0) { var regex = /^[a-zA-Z0-9äöüÄÖÜ #]*$/; var key = myForm.q3_4.value; if (!regex.test(key)) { myForm.q3_4.select(); myForm.q3_4.focus(); errorMessage = "Please only use letters, numbers, spaces and the # symbol in your relationship."; alertify.alert("Error!", errorMessage); return false; } } // Check Relationship if (myForm.q3_5.value.length > 0) { var regex = /^[a-zA-Z0-9äöüÄÖÜ #]*$/; var key = myForm.q3_5.value; if (!regex.test(key)) { myForm.q3_5.select(); myForm.q3_5.focus(); errorMessage = "Please only use letters, numbers, spaces and the # symbol in your city."; alertify.alert("Error!", errorMessage); return false; } } } //Q4 if(!myForm.q4[0].checked && !myForm.q4[1].checked && !myForm.q4[2].checked) { var Question_label = document.getElementById('qFelony_label').value; if ($('#language').val() == 'es') errorMessage = "Por favor, conteste la pregunta " + Question_label + " para continuar."; else errorMessage = "Please answer question " + Question_label + " to continue."; alertify.alert("Error!", errorMessage); return false; } else if((myForm.q4[0].checked || myForm.q4[2].checked) ) { if (myForm.q4_1.value.length > 0 && !isValidDate(myForm.q4_1)) { //if q4 = Y or U, and a conviction date was entered, verify that it is a valid date myForm.q4_1.select(); myForm.q4_1.focus(); if ($('#language').val() == 'es') errorMessage = "Por favor, introduzca una fecha válida convicción usando el formato mm/dd/aaaa o deje el campo en blanco para continuar."; else errorMessage = "Please enter a valid conviction date using the format mm/dd/yyyy or leave the field blank to continue."; alertify.alert("Error!", errorMessage); return false; } if (myForm.q4_2.value.length > 0 && !isValidDate(myForm.q4_2)) { //if q4 = Y or U, and a release date was entered, verify that it is a valid date myForm.q4_2.select(); myForm.q4_2.focus(); if ($('#language').val() == 'es') errorMessage = "Por favor, introduzca una fecha de lanzamiento válido usando el formato mm/dd/aaaa o deje el campo en blanco para continuar."; else errorMessage = "Please enter a valid release date using the format mm/dd/yyyy or leave the field blank to continue."; alertify.alert("Error!", errorMessage); return false; } if ( (myForm.q4_1.value.length > 0 && isValidDate(myForm.q4_1)) && (myForm.q4_2.value.length > 0 && isValidDate(myForm.q4_2)) && cmpDate(myForm.q4_1, myForm.q4_2) == 1 ) { //if q4 = Y or U, and both dates are not empty and both valid, AND the date of release preceeds the date of conviction, return an error myForm.q4_2.select(); myForm.q4_2.focus(); if ($('#language').val() == 'es') errorMessage = "Su fecha de lanzamiento no puede preceder a la fecha de la condena. Corrija esto continúe."; else errorMessage = "Your release date cannot precede your conviction date. Please correct this to continue."; alertify.alert("Error!", errorMessage); return false; } if (myForm.q4_3.value.length > 0 && !isValidName(myForm.q4_3)) { myForm.q4_3.select(); myForm.q4_3.focus(); if ($('#language').val() == 'es') errorMessage = "Please enter a valid name."; else errorMessage = "Please enter a valid name."; alertify.alert("Error!", errorMessage); return false; } if (myForm.q4_4.value.length > 0 && !isValidPhone(myForm.q4_4)) { myForm.q4_4.select(); myForm.q4_4.focus(); if ($('#language').val() == 'es') errorMessage = "Please enter a valid phone number."; else errorMessage = "Please enter a valid phone number."; alertify.alert("Error!", errorMessage); return false; } } // end q4 //Q5 if(!myForm.q5[0].checked && !myForm.q5[1].checked && !myForm.q5[2].checked) { var Question_label = document.getElementById('qTTW_label').value; if ($('#language').val() == 'es') errorMessage = "Por favor, conteste la pregunta " + Question_label + " para continuar."; else errorMessage = "Please answer question " + Question_label + " to continue."; alertify.alert("Error!", errorMessage); return false; } else if((myForm.q5[0].checked || myForm.q5[2].checked) ) { if (myForm.q5_1.value.length > 0 && !isValidName(myForm.q5_1)) { myForm.q5_1.select(); myForm.q5_1.focus(); if ($('#language').val() == 'es') errorMessage = "Please enter a valid name."; else errorMessage = "Please enter a valid name."; alertify.alert("Error!", errorMessage); return false; } if (myForm.q5_2.value.length > 0 && !isValidPhone(myForm.q5_2)) { myForm.q5_2.select(); myForm.q5_2.focus(); if ($('#language').val() == 'es') errorMessage = "Please enter a valid phone number."; else errorMessage = "Please enter a valid phone number."; alertify.alert("Error!", errorMessage); return false; } if (myForm.q5_3.value.length > 0) { var regex = /^[a-zA-Z0-9äöüÄÖÜ #]*$/; var key = myForm.q5_3.value; if (!regex.test(key)) { myForm.q5_3.select(); myForm.q5_3.focus(); errorMessage = "Please only use letters, numbers, spaces and the # symbol in your address."; alertify.alert("Error!", errorMessage); return false; } } if (myForm.q5_4.value.length > 0 && !isValidName(myForm.q5_4)) { myForm.q5_4.select(); myForm.q5_4.focus(); if ($('#language').val() == 'es') errorMessage = "Please enter a valid name."; else errorMessage = "Please enter a valid name."; alertify.alert("Error!", errorMessage); return false; } } // end q5 //Q6 if(!myForm.q6[0].checked && !myForm.q6[1].checked && !myForm.q6[2].checked) { var Question_label = document.getElementById('qVeteran_label').value; if ($('#language').val() == 'es') errorMessage = "Por favor, conteste la pregunta " + Question_label + " para continuar."; else errorMessage = "Please answer question " + Question_label + " to continue."; alertify.alert("Error!", errorMessage); return false; } else if((myForm.q6[0].checked || myForm.q6[2].checked)) { var Question_label = document.getElementById('qVeteran_label').value; if (myForm.q6_1.value.length > 0 && !isValidDate(myForm.q6_1)) { //if q4 = Y or U, and a conviction date was entered, verify that it is a valid date myForm.q6_1.select(); myForm.q6_1.focus(); if ($('#language').val() == 'es') errorMessage = "Por favor, introduzca una fecha válida usando el formato mm/dd/aaaa o deje el campo en blanco para continuar."; else errorMessage = "Please enter a valid date using the format mm/dd/yyyy or leave the field blank to continue."; alertify.alert("Error!", errorMessage); return false; } if (!myForm.q6_2[0].checked && !myForm.q6_2[1].checked && !myForm.q6_2[2].checked) { myForm.q6_2[0].focus(); if ($('#language').val() == 'es') errorMessage = "Por favor, conteste la pregunta " + Question_label + ".2 para continuar."; else errorMessage = "Please answer question " + Question_label + ".2 to continue."; alertify.alert("Error!", errorMessage); return false; } if (!myForm.q6_3[0].checked && !myForm.q6_3[1].checked && !myForm.q6_3[2].checked) { myForm.q6_3[0].focus(); if ($('#language').val() == 'es') errorMessage = "Por favor, conteste la pregunta " + Question_label + ".3 para continuar."; else errorMessage = "Please answer question " + Question_label + ".3 to continue."; alertify.alert("Error!", errorMessage); return false; } if (!myForm.q6_4[0].checked && !myForm.q6_4[1].checked && !myForm.q6_4[2].checked) { myForm.q6_4[0].focus(); if ($('#language').val() == 'es') errorMessage = "Por favor, conteste la pregunta " + Question_label + ".4 para continuar."; else errorMessage = "Please answer question " + Question_label + ".4 to continue."; alertify.alert("Error!", errorMessage); return false; } if (!myForm.q6_5[0].checked && !myForm.q6_5[1].checked && !myForm.q6_5[2].checked) { myForm.q6_5[0].focus(); if ($('#language').val() == 'es') errorMessage = "Por favor, conteste la pregunta " + Question_label + ".5 para continuar."; else errorMessage = "Please answer question " + Question_label + ".5 to continue."; alertify.alert("Error!", errorMessage); return false; } else if((myForm.q6[0].checked || myForm.q6[2].checked) && myForm.q6_1.value.length > 0 && !isValidDate(myForm.q6_1)) { //if q6 = Y or U, and a discharge date was entered, verify that it is a valid date myForm.q6_1.select(); myForm.q6_1.focus(); if ($('#language').val() == 'es') errorMessage = "Por favor, introduzca una fecha de alta válido usando el formato mm/dd/aaaa o deje el campo en blanco para continuar."; else errorMessage = "Please enter a valid discharge date using the format mm/dd/yyyy or leave the field blank to continue."; alertify.alert("Error!", errorMessage); return false; } } //Q7 if(!myForm.q7[0].checked && !myForm.q7[1].checked && !myForm.q7[2].checked) { var Question_label = document.getElementById('qSSI_label').value; if ($('#language').val() == 'es') errorMessage = "Por favor, conteste la pregunta " + Question_label + " para continuar."; else errorMessage = "Please answer question " + Question_label + " to continue."; alertify.alert("Error!", errorMessage); return false; } if(!myForm.q8[0].checked && !myForm.q8[1].checked) { var Question_label = document.getElementById('qJurat_label').value; if ($('#language').val() == 'es') errorMessage = "Por favor, conteste la pregunta " + Question_label + " para continuar."; else errorMessage = "Please answer question " + Question_label + " to continue."; alertify.alert("Error!", errorMessage); return false; } printPage(); } function togglePlantName(myForm) { if(myForm.plant_y.checked == true) myForm.plantname.disabled = false; else myForm.plantname.disabled = true; } function exitQuestionnaire(myForm, exitString, parameters, target) { if(exitString.length == 0 || exitString == "?") { window.location = "https://questionnaire.waltonmgt.com/language.php" + exitString + parameters; } else { window.location = exitString + parameters; } // } function confirmOptOut() { var alertString = ""; if ($('#language').val() == 'es') alertString = "¿Está seguro de que desea optar por no completar la proyección crédito fiscal solicitada por su empleador? Completando estas preguntas no afecta a su empleo, sus respuestas son confidenciales, y al hacerlo será muy beneficioso para la empresa."; else alertString = "Are you certain that you would like to opt out of completing the tax credit screening requested by your employer? Completing these questions does not affect your employment, your answers are kept confidential, and doing so will be greatly beneficial to the company."; alertify.confirm( "Are you sure?", alertString , function() { printPage(); }, function() { document.getElementById("optout").checked = false; } ).setting('labels',{'ok':'Yes, opt out', 'cancel': 'No, take me back to the questionnaire'} ); } function confirmAnswersTrueAndCorrect() { if(myForm.q8[1].checked) { if ($('#language').val() == 'es') errorMessage = "Ha seleccionado No a esta pregunta. Si las respuestas que ha proporcionado no es verdadera, correcta y completa, por favor regrese a las preguntas y contestarlas correctamente y seleccionar afirmativamente a esta pregunta."; else errorMessage = "You have selected No to this question. If the answers you have provided are not true, correct, and complete, please return to the questions and answer them correctly and select yes to this question."; alertify.alert("Error!", errorMessage); } } function confirmNYAnswersTrueAndCorrect() { if(myForm.qe6[1].checked) { alertify.alert("Error!","You have not checked the box indicating your agreement with the statement. If the answers you have provided are not true, correct, and complete, please return to the questions and answer them correctly and select this box that you understand and are in agreement with the statement."); } }